<?php
/**
 * @ClassName: ShippingStatus
 * @Description: TODO
 * @author: gydtrade
 * @Date: 2025-09-26 11:38
 * @Version: V1.0.0
 */

namespace app\common\enum;

class ShippingStatus
{
    const not_shipped = 0;
    const shipped = 1;
    const part_shipment = 2;

    /**
     * 发货状态 0未发货 1已发货 2部分发货
     * @param $status
     * @return string|string[]
     */
    public static function shopText($status)
    {
        $desc = [
            ShippingStatus::not_shipped => '未发货',
            ShippingStatus::shipped => '已发货',
            ShippingStatus::part_shipment => '部分发货',
        ];
        if ($status === true) {
            return $desc;
        }
        return $desc[$status] ?? $status;
    }

    /**
     * 配送状态 0未配送 1已配送 2部分配送
     * @param $status
     * @return string|string[]
     */
    public static function waterText($status)
    {
        $desc = [
            ShippingStatus::not_shipped => '未配送',
            ShippingStatus::shipped => '已配送',
            ShippingStatus::part_shipment => '部分配送',
        ];
        if ($status === true) {
            return $desc;
        }
        return $desc[$status] ?? $status;
    }

}